﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using ExamSharedClasses;

namespace ExamSharedClasses.Commands {
    /// <summary>
    /// (k) Dieser "Befehl" enthält nur eine Nachricht und eine Id
    /// </summary>
    [Serializable()]
    public class Message : Command {

        public const string NAME = "message";
        public const string MESSAGE_ID = "message_id";
        public const string MESSAGE_TEXT = "message_text";

        public int MessageId { get; set; }
        public string MessageText { get; set; }

        public Message()
            : base() {
            MessageId = -1;
            MessageText = "";
        }
        public Message( int messageId, String messageText )
            : base() {
            this.MessageId = messageId;
            this.MessageText = messageText;
        }
        public Message( int messageId, String messageText, string source )
            : base( source ) {
            this.MessageId = messageId;
            this.MessageText = messageText;
        }



        public override string ToString() {
            StringBuilder sb = new StringBuilder( base.ToString() + "Message:" );
            sb.Append( MessageId.ToString() );
            if ( MessageText != null )
                sb.Append( MessageText );
            return base.ToString();
        }
    }
}
